<template>
    <div style="background:#F5F5F5;height: 95%;padding: 10px 150px">
        <el-container style="height: 100%">
            <el-aside width="200px" height="700px" style="padding-top: 20px;height: 700px">
                <!--                讲师中心-->
                <div v-show="member.type===1" style="text-align: center;background: white;border-radius: 5px">
                    <ul style="list-style: none;padding: 0;margin: 0">
                        <li>
                            <span class="el-icon-s-check big-title">&nbsp;讲师中心</span>
                            <el-divider></el-divider>
                        </li>
                        <li class="small-title">
                            <span @click="$router.push({name:'lbgl'})">录播管理</span><br>
                            <span @click="$router.push({name:'teacherCenter'})">讲师中心</span><br>
                        </li>
                    </ul>
                </div>
                <!--                个人资料-->
                <div style="text-align: center;background: white;margin-top:20px;border-radius: 5px ">
                    <ul style="list-style: none;padding: 0;margin: 0">
                        <li>
                            <span class="el-icon-s-custom big-title">&nbsp;个人资料</span>
                            <el-divider></el-divider>
                        </li>
                        <li class="small-title">
                            <span @click="infor">个人信息</span><br>
                        </li>
                        <li class="small-title">
                            <span @click="pass">修改密码</span><br>
                        </li>
                        <li class="small-title">
                            <span @click="order">我的订单</span><br>
                        </li>
                    </ul>
                </div>
                <!--                课程中心-->
                <div style="text-align: center;background: white;margin-top:20px;border-radius: 5px ">
                    <ul style="list-style: none;padding: 0;margin: 0">
                        <li>
                            <span class="el-icon-data-analysis big-title">&nbsp;课程中心</span>
                            <el-divider></el-divider>
                        </li>
                        <li class="small-title">
                            <span @click="collection">我的收藏</span><br>
                        </li>
                        <li class="small-title">
                            <span @click="course">我的课程</span><br>
                        </li>
                        <li class="small-title">
                            <span @click="study">学习记录</span><br>
                        </li>
                        <li class="small-title">
                            <span @click="follow">我的关注</span><br>
                        </li>
                    </ul>
                </div>
            </el-aside>
            <el-main style="border-radius: 5px;padding: 0;margin: 20px;">
                <router-view></router-view>
            </el-main>
        </el-container>
    </div>
</template>

<script>
    export default {
        name: "userindex",
        data() {
            return {
                member: [],
            }
        },
        methods: {
            infor() {
                this.$router.push("/information")
            },
            pass() {
                this.$router.push("/password")
            },
            order() {
                this.$router.push("/order")
            },
            study() {
                this.$router.push("/study")
            },
            course() {
                this.$router.push("/course")
            },
            collection() {
                this.$router.push("/collection")
            },
            follow() {
                this.$router.push("/follow")
            },
            loginStatus() {
                var that = this;
                var token = sessionStorage.getItem("token");
                if (token) {
                    this.$http.get(`/member/findMemberByToken/${token}`).then(function (success) {
                        that.member = success.data.result;
                    })
                }
            }
        },
        created() {
            this.loginStatus();
        }
    }
</script>

<style>
    .big-title {
        font-weight: bold;
        margin-top: 20px;
    }

    .small-title {
        line-height: 45px;
    }
</style>